package com.heima.media.config;

import com.heima.media.interceptor.UserInterceptor;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @BelongsProject: heima-leadnews
 * @BelongsPackage: com.heima.media.config
 * @Author: wangjian
 * @CreateTime: 2022-07-01  19:59
 * @Description: TODO
 * @Version: 1.0
 */
public class WebConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new UserInterceptor())
                .addPathPatterns("/**");    // 指定需要拦截的路径,拦截所有
    }
}
